from .views import *
from django.urls import path
from rest_framework.routers import DefaultRouter,SimpleRouter  # 默认路由器

# urlpatterns = [
#     path('students/',StudentsViewSet.as_view({'get':'list','post':'create'})),
#     path('students/<pk>/',StudentsViewSet.as_view({'get':'retrieve','put':'update','delete':'destory'})),
# ]

urlpatterns = []

# 创建路由器
router = DefaultRouter()
# 注册路由器
router.register('students',StudentsViewSet)
router.register('classes',ClassesViewSet)
# 路由添加至urlpatterns列表当中
urlpatterns += router.urls